<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script src="js/jquery.js"></script>
<script>
	$(document).ready(
			function() {

				$("#add_to_textarea").click(
						function() {
							$("#individual_students").append(
									$('input:text[name=selected_student]')
											.val()
											+ ";");

						});

				$("#s1").click(function() {

					var path = $("#f1").val().split("\\");
					$("#file_name").val(path[path.length - 1]);

				});

			}

	);
</script>
<style type="text/css">
#send {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
}
a{
	text-decoration:none 
}
a:LINK {
	color: #009ACD;
	
}

a:VISITED {
	color: #009ACD;
	
}
a:ACTIVE {
	color: black;
}

a:HOVER {
	color: red;
}

</style>
</head>
<body>
<font color="grey" style="font-family: calibri; font-size: medium;"><b>Send message</b> </font>
<div>
	<table>
		<tr><td valign="top" style="border-bottom-color: gray; border-bottom-style: solid; border-bottom-width: thin;">
		<s:url id="url1" action="message_batch"></s:url><s:a href="%{url1}"><font style="font-family: calibri; font-size: small;">To whole batch</font></s:a>
&emsp;<s:url id="url2" action="message_degree_batch"></s:url><s:a href="%{url2}"><font style="font-family: calibri; font-size: small;">To degree in particular year</font></s:a>
&emsp;<s:url id="url3" action="message_specialization"></s:url><s:a href="%{url3}"><font style="font-family: calibri; font-size: small;">To a particular specialization</font></s:a>
		
		</td></tr>
	</table>
</div>
<div>
	<form action="sendmessage_specialization.action" method="post"
		enctype="multipart/form-data">
		<input type="hidden" id="file_name" name="file_name" />
		<table align="center">
			<tr>
				<td width="250" valign="top" align="right"><font
					style="font-family: arial; font-size: small;">Receipent Batches</font></td>
				<td><s:iterator value="departments_list"><font
					style="font-family: arial; font-size: small;">
						<input type="checkbox" name="department_id" size="50"
							value="<s:property value="department_id"/>">
						<s:property value="department_name" />
						</input></font>
					</s:iterator></td>
			</tr>
			<tr>
				<td width="250" valign="top" align="right"><font
					style="font-family: arial; font-size: small;">Individual Students</font></td>
				<td><input type="text" name="selected_student" size="52"
					list="selected_student" /><input type="button" value="Add to List"
					id="add_to_textarea" /> <datalist id="selected_student">
					<s:iterator value="student_list">
						<option value="<s:property value="email_id"/>">
							<s:property value="student_name" />
						</option>
					</s:iterator> </datalist></td>

			</tr>
			<tr>
				<td width="250" valign="top" align="right"><font
					style="font-family: arial; font-size: small;">Selected Students</font></td>
				<td><textarea rows="3" cols="50"
						name="individual_students_emails" id="individual_students"></textarea></td>
			</tr>
			<tr>
				<td width="250" valign="top" align="right"><font
					style="font-family: arial; font-size: small;">Subject</font></td>
				<td style=""><input type="text" required="true" name="subject"
					size="66" /></td>
			</tr>
			<tr>
				<td width="250" valign="top" align="right"><font
					style="font-family: arial; font-size: small;">Body</font></td>
				<td><textarea rows="17" cols="50" name="body" required="true">
At W3Schools you will find all the Web-building tutorials you need,
from basic HTML to advanced XML, SQL, ASP, and PHP. 
</textarea></td>

			</tr>
			<tr>
				<td width="250" valign="top" align="right"><font
					style="font-family: arial; font-size: small;">Attach a File</font></td>
				<td><input type="file" id="f1" name="attached_file"  size="54" /></td>
			</tr>
			<tr>
				<td id="send" height="65" style="background-color: gray;" colspan="2" align="center" valign="middle"><input type="submit" id="s1"
					value="Send the Mail" /></td>
			</tr>
		</table>




	</form>
	</div>
</body>
</html>